#ifndef QFUNCODETREEWIDGET_H
#define QFUNCODETREEWIDGET_H

#include <QTreeWidget>
#include <QMap>

struct tagValueGroup;

class QFunCodeTreeWidget : public QTreeWidget
{
    Q_OBJECT
public:
    explicit QFunCodeTreeWidget(QWidget *parent = 0);
    
    void    set_groups(QList<tagValueGroup*> list);
    void    clear();
protected:
    void contextMenuEvent(QContextMenuEvent *);
protected slots:
    void    set_current_item(QTreeWidgetItem* item);

    void    update_group();
    void    update_all();
signals:
    void    select_changed(tagValueGroup* group);
public slots:
protected:
    QMap<tagValueGroup*,QTreeWidgetItem*>     m_group_to_item;
    QMap<QTreeWidgetItem*,tagValueGroup*>     m_item_to_group;

    QTreeWidgetItem*                          m_current_item;
};

#endif // QFUNCODETREEWIDGET_H
